<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"  %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>办事指南</title>
    <base href="<%=basePath%>">
    <%@ include file="/main/main_css.jsp" %>
    <%@ include file="/main/main_js.jsp" %>
    <script src="JS/main.js"></script>
    <script src="JS/A4Print.js"></script>
</head>
<body>
    <!--  -->
    <div class="all-wrapper">
        <div class="row com-header text-center">
            <span>鹰潭市行政服务中心 </span>
        </div>
        <div class="row main-content time-table">
        	<div class="row">
				<div class="time-count pull-right">
					<span>剩余</span> <span id="time" class="text-red"></span> <span>秒</span>
				</div>
			</div>
			<div class="row">
	                <h1>${itemName }办事指南</h1>
	        </div>
	        <div class="pull-right" style="margin-bottom: 10px">
	        	<div id="info" class="btn item-info btn-lg">
	        		<span class="item-font">基本信息</span>
	        		<div id="info-img" class="item-btn">
	        			<img alt="" src="static/image/file-upload/triangle.png">
	        		</div>
	        	</div>
	        	<div id="admiss" class="btn item-info btn-lg">
	        		<span class="item-font">受理条件</span>
	        		<div id="admiss-img" class="item-btn">
	        			<img alt="" src="static/image/file-upload/triangle.png">
	        		</div>
	        	</div>
	        	<div id="setBasis" class="btn item-info btn-lg">
	        		<span class="item-font">设定依据</span>
	        		<div id="setBasis-img" class="item-btn">
	        			<img alt="" src="static/image/file-upload/triangle.png">
	        		</div>
	        	</div>
	        	<div id="reqMaterials" class="btn item-info btn-lg">
	        		<span class="item-font">所需材料</span>
	        		<div id="reqMaterials-img" class="item-btn">
	        			<img alt="" src="static/image/file-upload/triangle.png">
	        		</div>
	        	</div>
	        </div>
	        <div class="info-table">
	          <table class="table table-bordered time-table-com" style="border:1px solid #efefef;">
	                <tbody>
	                	<tr>
	                        <td class="x" style="width: 250px">事项名称</td>
	                        <td><font size="5px">${itemDataObj.getITEMNAME() }</font></td>
	                        <td class="x" style="width: 250px">主办单位</td>
	                        <td><font size="5px">${itemDataObj.getNORMACCEPTDEPART() }</font></td>
	                        
	                    </tr>
	                    <tr>
	                    	<td class="x" style="width: 20%">办理时间</td>
	                        <td style="width: 30%"><font size="5px">${itemDataObj.getBLSJ() }</font></td>
	                        <td class="x">办理地点</td>
	                        <td><font size="5px">${itemDataObj.getBLWINDOW() }</font></td>
	                    </tr>
	                    <tr>
	                    	<td class="x">办理时限</td>
	                       	<td><font size="5px">${itemDataObj.getNORMTIMELIMIT() }</font></td>
	                        <td class="x">是否收费</td>
	                        <td>
	                        	<c:if test="${itemDataObj.getSFSF().equals('0') }"><font size="5px">否</font></c:if>
	                        	<c:if test="${itemDataObj.getSFSF().equals('1') }"><font size="5px">是</font></c:if>
	                        </td>
	                    </tr>
	                     <tr>
	                       <td class="x">到办事窗口的最少次数</td>
	                       <td><font size="5px">${itemDataObj.getDEGREE() }</font></td>
	                        <td class="x">收费金额</td>
	                       <td><font size="5px">${itemDataObj.getSFJE() }</font>
	                       		<c:if test="${itemDataObj.getSFSF().equals('0') }"><font size="5px">不收费</font></c:if>
	                        	<c:if test="${itemDataObj.getSFSF().equals('1') }"><font size="5px">${itemDataObj.getSFJE() }</font></c:if>
	                       </td>
	                    </tr>
	                     <tr>
	                     	<td class="x">监督投诉电话</td>
	                        <td ><font size="5px">${itemDataObj.getJDTSDH()}</font></td>
	                       <td class="x">咨询电话</td>
	                       <td><font size="5px">${itemDataObj.getZXMKZXDH() }</font></td>
	                    </tr>
	                </tbody>
	            </table>
			</div>
			<!-- 受理条件 -->
			<div class="admiss-table">
				<table class="table table-bordered time-table-com" style="border:1px solid #efefef;">
					<tbody>
						<tr>
							<td class="x">受理条件</td>
						</tr>
						<tr>
							<td><font size="5px">${itemDataObj.getTRANSACT_CONDITION() }</font></td>
						</tr>
					</tbody>
				</table>
			</div>
			
			<!-- 设定依据 -->
			<div class="setBasis-table">
				<table class="table table-bordered time-table-com" style="border:1px solid #efefef;">
					<tbody>
						<tr>
							<td class="x">设定依据</td>
						</tr>
						<tr>
							<td><font size="5px">${itemDataObj.getSDYJ() }</font></td>
						</tr>
					</tbody>
				</table>
			</div>
			<!-- 所需材料 -->
			<div class="reqMaterials-table">
				<table class="table table-bordered time-table-com" style="border:1px solid #efefef;">
					<tbody>
						<tr>
							<td class="x">所需材料</td>
						</tr>
						<tr>
							<td>
								<font size="5px">
								<c:forEach var="files" items="${fileDataList }" varStatus="status">
										${status.index + 1 }、${files.CLNAME }<br/>
								</c:forEach>
								</font>
							</td>
						</tr>
					</tbody>
				</table>
			</div>
        </div>
        <div class="row footer">
            <a class="btn btn-success btn-lg" href="loginOut" role="button"><i class="fa fa-reply"></i>返回首页</a>
            <a class="btn btn-primary btn-lg" href="javascript:history.go(-1)" role="button"><i class="fa fa-arrow-left"></i>上一步</a>
       	<c:if test="${itemDataObj.ISZXBL.equals('true') }" >
	            <a class="btn btn-primary btn-lg"  id="ZXSB" href="/smartTerminal/getuseroritem?types=${types }&type=${type }&itemId=${itemDataObj.getITEMID() }" role="button"><i class="fa fa-hand-pointer-o"></i>在线申报</a>
   		 </c:if>
       	<c:if test="${itemDataObj.ISZXBL.equals('false') }" >
	            <a class="btn btn-default btn-lg"  disabled="disabled"  id="ZXSB" href="/smartTerminal/getuseroritem?types=${types }&type=${type }&itemId=${itemDataObj.getITEMID() }" role="button"><i class="fa fa-hand-pointer-o"></i>在线申报</a>
   		 </c:if>
            <!-- <a class="btn btn-primary btn-lg" id="order" role="button">预约<i class="fa fa-hand-pointer-o"></i></a> -->
            <button class="btn btn-primary btn-lg" href="javascript:void(0);" role="button" onclick="printHtml();"><i class="fa fa-hand-pointer-o"></i>打印</button>
           <!--  <a class="btn btn-primary btn-lg hidden" href="" role="button">提交<i class="fa fa-hand-pointer-o"></i></a> -->
        </div>
    </div>
    <input type="hidden" id="setBasisVal" value="${itemDataObj.getSDYJ() }"/>
    <input type="hidden" id="jdtsVal" value="${itemDataObj.getJDTSDH()}"/>
    <input type="hidden" id="transactVal" value="${itemDataObj.getTRANSACT_CONDITION() }"/>
    <div id="fileData">
	    <c:forEach var="files" items="${fileDataList }" varStatus="status">
	    	<input type="hidden" value="${files.CLNAME }"/>
	    </c:forEach>
    </div>
    <c:if test="${itemDataObj.getSFSF().equals('0') }" >
    	 <input type="hidden" id="SFJE" value="不收费"/>
    </c:if>
    <c:if test="${itemDataObj.getSFSF().equals('1') }" >
    	 <input type="hidden" id="SFJE" value="${itemDataObj.getSFJE() }"/>
    </c:if>
    <form id="loginOut" action="loginOut"></form>
    <script type="text/javascript">
	    $('#order').on('click',function(){
	        var index = layer.load(3, {
	            shade: [0.3,'#000'] //0.1透明度的白色背景  
	        });
	        setTimeout(function(){
	            layer.close(index);
	        },1000);
	        $(this).attr("href","/smartTerminal/getMessage?types=${types }&type=${type }&itemid=${itemDataObj.getITEMID() }&deptName=${itemDataObj.getNORMACCEPTDEPART() } &itemName=${itemDataObj.getITEMNAME() }");
	    });
    	
	    function printHtml(){
	  		/* var test = '<div style="height:100%;width:100%;margin-left:40px">';
  			test += '<div style="margin-top:200px;align:center;"><h1>${Receipt.ITMENAME }${itemDataObj.getITEMNAME() }办事指南</h1></div>';
     		test += '<table border="1" cellspacing="0" bordercolor="#000000" width = "80%" style="margin-top:20px;align:center;">';
    		test += '<tr><td style="width:20%">监督投诉电话:</td><td >'+$('#jdtsVal').val()+'</td><td>办理地点:</td><td style="width:20%">${itemDataObj.getBLWINDOW() }</td></tr>';
    		if(${itemDataObj.getSFSF().equals('0') }){
    			test += '<tr><td>是否收费</td><td>否</td> <td >办理时间</td><td >${itemDataObj.getBLSJ() }</td></tr>';
    		}else{
    			test += '<tr><td>是否收费</td><td>是</td> <td >办理时间</td><td >${itemDataObj.getBLSJ() }</td></tr>';
    		}
    		test += '<tr><td >主办单位:</td><td>${itemDataObj.getNORMACCEPTDEPART() }</td><td >事项编码:</td><td>${itemDataObj.getSXBM() }</td></tr>';
         	test += '<tr><td >事项名称:</td><td>${itemDataObj.getITEMNAME() }</td><td >办理时限:</td><td>${itemDataObj.getNORMTIMELIMIT() }</td></tr>';
         	test += '<tr><td >咨询电话:</td><td>${itemDataObj.getZXMKZXDH() }</td><td >到办事窗口的最少次数:</td><td>${itemDataObj.getDEGREE() }</td></tr>';
         	test += '<tr><td >受理条件:</td><td>'+$('#transactVal').val()+'</td><td >收费金额￥:</td><td>${itemDataObj.getSFJE() }</td></tr>';
         	test += '<tr><td >设定依据:</td><td colspan="3">'+$('#setBasisVal').val()+'</td></tr>';
         	test += '<tr><td >所需材料:</td><td colspan="3">';
         	$('#fileData').find('input').each(function(i,v){
         		test += (i+1)+'.'+$(this).val()+'<br/>';
	    	});
         	test += '</td></tr>';
     		test += '</table>';
     		test += '</div>';
     		 */	 	
	    	var test = '<div style="height:100%;width:120%;margin-left:40px">';
  			test += '<div style="align:center;"><h1 style="margin-left:33%;">办事指南</h1></div>';
     		test += '<table border="1" cellspacing="0" bordercolor="#000000" width = "80%" style="margin-top:20px;align:center;">';
    		test +='<tr><td >事项名称:</td><td>${itemDataObj.getITEMNAME() }</td><td >主办单位:</td><td>${itemDataObj.getNORMACCEPTDEPART() }</td></tr>';
			test += '<tr><td>办理时间</td><td >${itemDataObj.getBLSJ() }</td><td>办理地点:</td><td style="width:20%">${itemDataObj.getBLWINDOW() }</td></tr>';
			test += '<tr><td >办理时限:</td><td>${itemDataObj.getNORMTIMELIMIT() }</td>';
			if(${'0'.equals(itemDataObj.getSFSF()) }){
    			test += '<td>是否收费</td><td>否</td> </tr>';
    		}else{
    			test += '<td>是否收费</td><td>是</td> </tr>';
    		};
			test += '<tr><td >到办事窗口的最少次数:</td><td>${itemDataObj.getDEGREE() }</td><td >收费金额￥:</td><td>'+$('#SFJE').val()+'</td></tr>';
			test += '<tr><td style="width:20%">监督投诉电话:</td><td >'+$('#jdtsVal').val()+'</td><td >咨询电话:</td><td>${itemDataObj.getZXMKZXDH() }</td><tr>';
         	test += '<tr><td >受理条件:</td><td colspan="3">'+$('#transactVal').val()+'</td></tr>';
         	test += '<tr><td >设定依据:</td><td colspan="3">'+$('#setBasisVal').val()+'</td></tr>';
         	test += '<tr><td >所需材料:</td><td colspan="3">';
         	$('#fileData').find('input').each(function(i,v){
         		test += (i+1)+'.'+$(this).val()+'<br/>';
	    	});
         	test += '</td></tr>';
     		test += '</table>';
     		test += '</div>';
     		//layer.alert(test);
	 	   	send_command(
		  	        "printhtml",
		  	      	test,
		  	        function (json) {
		  	            
		  	    }); 
	 	   var index = layer.load(3, {
			    shade: [0.3,'#000'] //0.1透明度的白色背景  
				});
		   layer.msg('文件打印中,请稍等片刻......', {time:3000}); 
				setTimeout(function(){
				    layer.close(index);
			},3000);
	  	}
	    
	    //显示基本信息
	    $('#info').on('click',function(){
	    	$('#info').css('background','#419641');
	    	$('#admiss').css('background','#265a88');
	    	$('#setBasis').css('background','#265a88');
	    	$('#reqMaterials').css('background','#265a88');
	    	
	    	$('.info-table').removeClass('hide');
	    	$('.admiss-table').addClass('hide');
	    	$('.setBasis-table').addClass('hide');
	    	$('.reqMaterials-table').addClass('hide');
	    	
	    	$('#info-img').removeClass('hide');
	    	$('#admiss-img').addClass('hide');
	    	$('#setBasis-img').addClass('hide');
	    	$('#reqMaterials-img').addClass('hide');
	    });
	    
	    //显示受理条件
	    $('#admiss').on('click',function(){
	    	$('#info').css('background','#265a88');
	    	$('#setBasis').css('background','#265a88');
	    	$('#reqMaterials').css('background','#265a88');
	    	$('#admiss').css('background','#419641');
	    	
	    	$('.admiss-table').removeClass('hide');
	    	$('.info-table').addClass('hide');
	    	$('.setBasis-table').addClass('hide');
	    	$('.reqMaterials-table').addClass('hide');
	    	
	    	$('#admiss-img').removeClass('hide');;
	    	$('#info-img').addClass('hide');
	    	$('#setBasis-img').addClass('hide');
	    	$('#reqMaterials-img').addClass('hide');
	    });
	    
	    //显示设定依据
	    $('#setBasis').on('click',function(){
	    	$('#info').css('background','#265a88');
	    	$('#admiss').css('background','#265a88');
	    	$('#reqMaterials').css('background','#265a88');
	    	$('#setBasis').css('background','#419641');
	    	
	    	$('.admiss-table').addClass('hide');
	    	$('.info-table').addClass('hide');
	    	$('.setBasis-table').removeClass('hide');
	    	$('.reqMaterials-table').addClass('hide');
	    	
	    	$('#setBasis-img').removeClass('hide');;
	    	$('#info-img').addClass('hide');
	    	$('#admiss-img').addClass('hide');
	    	$('#reqMaterials-img').addClass('hide');
	    });
	    
	    //所需材料
	    $('#reqMaterials').on('click',function(){
	    	$('#info').css('background','#265a88');
	    	$('#admiss').css('background','#265a88');
	    	$('#reqMaterials').css('background','#419641');
	    	$('#setBasis').css('background','#265a88');
	    	
	    	$('.admiss-table').addClass('hide');
	    	$('.info-table').addClass('hide');
	    	$('.setBasis-table').addClass('hide');
	    	$('.reqMaterials-table').removeClass('hide');
	    	
	    	$('#reqMaterials-img').removeClass('hide');;
	    	$('#info-img').addClass('hide');
	    	$('#admiss-img').addClass('hide');
	    	$('#setBasis-img').addClass('hide');
	    });
	    
	    $('#info').click();
    </script>
</body>
<!-- 添加动画 -->
<script type="text/javascript">


	var index = layer.load(3, {
	    shade: [0.3,'#000'] //0.1透明度的白色背景  
	});
	setTimeout(function(){
	    layer.close(index);
	},500);
	 
	
	//页面倒计时
		var count = 119;
		function countdown(){
			$("#time").text(count);
			if(count > 0){
				window.setTimeout("countdown()",1000);
				count --;
			}else{
				$("#loginOut").submit();
			}
		}
		countdown();
		
		var winH = $(document).height();
        var mainH = winH - 160;
        $('.main-content').height(mainH);
</script>
</html>
